var vm = new Vue({
    el: "#pageBody",
    data: {
        code: code,
        listTable: null,
        table: null
    },
    ready: function() {
        var _self = this;

        layui.use(['table', 'layer', 'form'], function() {
            var table = layui.table;
            _self.table = table;
            layer = layui.layer;
            _self.listTable = table.render({
                id: "dataGrid",
                elem: '#dataGrid',
                height: 'full-140',
                loading: true,
                even: true,
                cols: [[
                    //{title: "操作", toolbar: "#barBtn", minWidth: 100},
                    {title: "工单号", field: "CODE", minWidth: 155},
                    {title: "形体", field: "PRODUCT", minWidth: 200},
                    {title: "形状", field: "SHAPE", minWidth: 90},
                    {title: "规格", field: "SPEC", minWidth: 100},
                    {title: "数量", field: "QTY", minWidth: 80},
                    {title: "备注", field: "DESCRIPTION", minWidth: 200},
                ]],
                method: "post",
                url: host + "jobOrderController/getJobPaibanInfo?id=" + request("id"),
                page: false, //是否显示分页
                limit: 100,//每页默认显示的数量
                done: function(res, curr, count) {
                    layuiRowspan(['CODE'], 1);//支持数组
                }
            });
            table.on('tool(dataGrid)', function(obj) {
                if(obj.event === 'update') {
                    var i= _self.addReportWindow(table, obj);
                }
                if(obj.event === 'view') {
                    var i= _self.testView(obj);
                }
            });
        });
    },
    methods: {
        /*条件查询*/
        searchData: function() {
            this.listTable.reload({page: {curr: 1}, where: {}});
        },
        send: function(_self) {
        },
        close: function() {
            top.layer.close(top.winIndex);
        },
        showHistory: function () {
            top.layer.open({
                type: 2,
                title: "排版历史",
                shadeClose: true,
                shade: 0.6,
                area: ['80%', '80%'],
                fixed:true,
                content: host + 'mes/manu/cdJobHistory.html',
                end:function(){
                }
            });
        }
    }
});